<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>RFC 4122 Generating - lifanko</title>
    <meta name="description" content="RFC 4122 Generating lifanko">
    <link rel="icon" href="../favicon.ico" type="image/x-icon">
    <style>
        .container {
            text-align: center;
        }

        .emphasize {
            color: #28d153;
        }

        .uuid {
            font-size: 30px;
            color: brown;
            font-family: Garamond;
        }

        input {
            width: 50%;
            height: 25px;
            padding: 2px 5px;
            outline: none;
        }
    </style>
</head>
<body>
<div class="container">
    <h2>Generating RFC 4122 <span class="emphasize">U</span>niversally <span class="emphasize">U</span>nique <span
            class="emphasize">ID</span>entifiers(version5)</h2>
    <p>Interface: ali.lifanko.cn/uuid/app.php Method: GET Key: param</p>
    <p style="margin-top: 5%">Namespace: <span class="emphasize">6ba7b810-9dad-11d1-80b4-00c04fd430c8</span></p>
    <input type="text" placeholder="The name to create a UUID for" id="param">

    <p class="uuid" id="uuid">Please Input Parameter</p>
</div>
<script type="text/javascript" src="http://cdn.lifanko.cn/jquery-2.1.1.min.js"></script>
<script>
    var uuid = document.getElementById("uuid");
    var params = document.getElementById("param");
    var params_buffer;

    // Check input every second
    setInterval(function () {
        if (params.value !== '' && params.value !== params_buffer) {
            params_buffer = params.value;
            query();
        }
    }, 1000);

    function query() {
        uuid.innerText = 'Pending...';

        $.get("app.php", {   //获取最新列表
            param: params.value
        }, function (data) {
            uuid.innerText = data;
        }).error(function () {
            uuid.innerText = 'Error, Please try again later...';
        });
    }
</script>
</body>
</html>